package com.ophelisis.actions.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/** <pre>
 * Class : com.apexcns.xdp.actions.common.ConfirmMessage / ConfirmMessage.java
 * 	Define Class Object : 
 * <br>
 * </pre>
 * @author hlee / apexcns,Inc.
 * @version 1.0
 * @see javadoc
 * @since 2013. 01. 17.
 */
@Controller
public class ConfirmMessage {
	private Log log = LogFactory.getLog(this.getClass());
	private static final String _LogPrefixStr = "ConfirmMessage Log> ";

	@RequestMapping(value="confirmMessage.action")
	public ModelAndView confirmMessage(
			HttpServletRequest request,
			HttpServletResponse response,
			@RequestParam(value="contents", defaultValue="") String sContents,
			@RequestParam(value="result", defaultValue="") String sResult) throws Exception {
		ModelAndView mav = new ModelAndView();
		
		log.debug(_LogPrefixStr + "|" + "------------------------------------------------------------------------------------");
		log.debug(_LogPrefixStr + "|" + " ConfirmMessage called !!!");
		log.debug(_LogPrefixStr + "|" + "------------------------------------------------------------------------------------");

		mav.addObject("result", sResult);
		mav.addObject("contents", new String(sContents.getBytes("iso-8859-1"), "UTF-8"));
		mav.setViewName("/WEB-INF/jsp/common/confirmMessage.jsp");
		
		return mav;
	}
}

